<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<base href="http://localhost/notebook/" />
	<meta name='viewport' content='width=device-width, initial-scale=1, user-scalable=no' />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<link rel="stylesheet" href="css/zui.min.css" />
	<script src="js/jquery.js"></script>
	<script src="js/zui.min.js"></script>
	<script src="js/google-code-prettify/prettify.js"></script>
	<title>一个模块显示的示例</title>
</head>
<body>
<header class="default">
	<div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="loginDIalog" aria-hidden="true">

	</div>
	<div class="modal fade" id="userInfo" tabindex="-1" role="dialog" aria-labelledby="myModalTitle" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalTitle"> <i class='icon-user'></i> <?=$_SESSION['userName']?>
					</h4>
				</div>
				<div class="modal-body">
					<div class="alert alert-info with-icon"><i class="icon-info-sign"></i> 如需修改密码，请在下面输入当前密码与新密码并点击“确认修改”。</p></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">姓名:<?=$rec->userName?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">账号:<?=$rec->account?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">手机:<?=$rec->mobile?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">座机:<?=$rec->phone?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">职务:<?=$job->job?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">班组:<?=$workClass->workClassName?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">姓名:<?=$rec->userName?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">账号:<?=$rec->account?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">手机:<?=$rec->mobile?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">座机:<?=$rec->phone?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">职务:<?=$job->job?></div>
				</div>
				<div class="row">
					<div class="col-md-offset-2">班组:<?=$workClass->workClassName?></div>
				</div>
				<form name="sureRec" method="POST" action="modules/user/changepwd.php">
					<div class="row">
						<div class="col-md-offset-2">
							<input type="hidden" name="status" value="updatePassword" />
							当前密码<input type='password' name='oldPassword' size='16' maxlength='15' />
							新密码<input type='password' name='newPassword' size='16' maxlength='15' /><input class='btn btn-primary' type="submit" name="sure" value="确认修改" />
						</div>
				</form>
				<!-- 模态对话框的页脚 -->
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary">保存</button>
				</div>
			</div>
			<!-- /.modal-content --> </div>
		<!-- /.modal-dialog --> </div>
	<!-- /.modal --> </div>
	<div class="container-fluid">
		<nav class="navbar navbar-inverse" role="navigation">

			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="../code/core_php">双迪设备运行管理系统</a>
			</div>

			<div class="collapse navbar-collapse navbar-collapse-example" id="navbar-collapse">
				<ul class="nav navbar-nav">
					<li><a href="#userInfo" data-toggle="modal"><i class="icon-user"></i> 账号管理</a></li>
<?php
/**
 * Created by PhpStorm.
 * User: ford
 * Date: 14-9-13
 * Time: 下午1:49
 */

//定义数组库连接
$db = mysqli_connect('localhost', 'root', 'al8840dd', 'machinemanager');
$sql = "SELECT * FROM modules WHERE parentId = 0 ORDER BY modulesId ASC";
$result_parent_menu = mysqli_query($db, $sql);


while($row = mysqli_fetch_array($result_parent_menu, MYSQLI_BOTH))
{
	echo '
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="'.$row['icon'].'"></i>'.$row['name'].'<b class="caret"></b></a>
				<ul class="dropdown-menu" role="menu">';
	$sql_items = 'SELECT * FROM modules WHERE parentId = '.$row['modulesId'];
	$result_item = mysqli_query($db, $sql_items);

	while($row = mysqli_fetch_array($result_item, MYSQLI_BOTH))
	{
		echo '<li><a href="'.$row['pageAddress'].'"><i class="'.$row['icon'].'"></i> '.$row['name'].'</a></li>';
	}

	echo '
				</ul>
			</li>';

}
?>
					<li><a href="./index.php?p=logout"><i class="icon-signout"></i> 退出</a></li>
				</ul>
			</div>
		</nav>
	</div>
</header>
</body>
</html>